Image processing device, and  image processing method,

ABSTRACT

It is possible to generate a panoramic moving image with a high combination performance while suppressing a calculation amount. The positional-shift-amount acquisition unit acquires positional shift amounts of a predetermined number of frames from a first moving image and a second moving image captured by cameras, each of the first and second moving images including a plurality of frames. The frame selection unit selects the predetermined number of frames from the plurality of frames. For example, the frame selection unit selects the predetermined number of frames on the basis of sensor output and/or image processing results. An image combination unit combines the first moving image and the second moving image on the basis of the positional shift amounts of the predetermined number of frames to obtain a panoramic image.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation application of U.S. patentapplication Ser. No. 15/302,360, filed on Oct. 6, 2016, which is a U.S.National Phase of International Patent Application No. PCT/JP2015/061082filed on Apr. 9, 2015, which claims priority benefit of Japanese PatentApplication No. JP 2014-085198 filed in the Japan Patent Office on Apr.17, 2014. Each of the above-referenced applications is herebyincorporated herein by reference in its entirety.

TECHNICAL FIELD

The present technique relates to an image processing device, an imageprocessing method, and a program and particularly relates to an imageprocessing device and an image processing method for processing aplurality of moving images including overlapping regions.

BACKGROUND ART

When a panoramic moving image is generated by using a plurality ofmoving images, it is not realistic to perform positional-shift-amountcalculation processing on all frames in terms of performance and acalculation cost. For example, Patent Literature 1 seeks a solution bycalculating a positional shift amount in a first frame and, insubsequent frames, correcting the positional shift amount on the basisof a result of motion detection between the frames.

CITATION LIST Patent Literature

Patent Literature 1:

JP 4577765B SUMMARY OF INVENTION Technical Problem

In a technique disclosed in Patent Literature 1, regions to be used forpositioning are not limited. Therefore, when a positional shift amountis calculated by using information on parts other than overlapping partsof moving images, a positional-shift-amount calculation performance isreduced, and, because calculation is performed on the whole region, acalculation cost is increased. Further, in the technique disclosed inPatent Literature 1, correction is performed in each frame. Thus, when avector varies in each frame, an image is blurred, and therefore it isdifficult to see the image, and, because calculation is performed ineach frame, the calculation cost is increased.

An object of the present technique is to obtain a panoramic moving imageby generating a panoramic moving image with a high combinationperformance while suppressing a calculation amount.

Solution to Problem

The concept of the present technique is an image processing device,including: a positional-shift-amount acquisition unit configured toinclude a frame selection unit configured to select a first moving imageand a second moving image, each of which has a predetermined number offrames, from a first moving image and a second moving image, each ofwhich has a plurality of frames captured by a camera, and acquirepositional shift amounts of the predetermined number of frames from thefirst moving image and the second moving image, each of which has thepredetermined number of frames selected in the frame selection unit.

In the present technique, the positional-shift-amount acquisition unitacquires positional shift amounts of a predetermined number of framesfrom a first moving image and a second moving image captured by cameras,each of the first and second moving images including a plurality offrames. The frame selection unit selects the predetermined number offrames from the plurality of frames. For example, the frame selectionunit may select the predetermined number of frames on the basis ofsensor output and/or image processing results. In this case, forexample, the predetermined number of frames are selected in terms of,for example, a frame-positional-shift-amount calculation performance.For example, when a moving image includes N frames, M frames (N>M) areselected.

For example, the frame selection unit may select, as the predeterminednumber of frames, a frame having a small number of close subjects. Inaddition, for example, the frame selection unit may select, as thepredetermined number of frames, a frame that is not obtained byirregular camerawork. In addition, for example, the frame selection unitmay select, as the predetermined number of frames, a frame having alarge number of high frequency components.

In addition, for example, the frame selection unit may select, as thepredetermined number of frames, a frame having high reliability. Inaddition, for example, the frame selection unit may select, as thepredetermined number of frames, frames having close positional shiftamounts. In addition, for example, the frame selection unit may classifythe positional shift amounts into classes and select, as thepredetermined number of frames, a frame having positional shift amountsbelonging to a predetermined class.

In addition, for example, the frame selection unit may select, as thepredetermined number of frames, arbitrary consecutive frames. Inaddition, for example, the frame selection unit may select, as thepredetermined number of frames, frames having an arbitrary interval. Inaddition, for example, the frame selection unit does not have to select,as the predetermined number of frames, frames in first and/or lastcertain periods.

As described above, in the present technique, positional shift amountsof a predetermined number of frames selected from a plurality of framesare acquired. Therefore, it is possible to reduce a calculation cost forobtaining a positional shift amount. Further, as the positional shiftamounts, only accurate positional shift amounts can be acquired.

In the present technique, for example, the image processing device mayfurther include: an image combination unit configured to combine thefirst moving image and the second moving image on the basis of thepositional shift amounts of the predetermined number of frames to obtaina panoramic moving image. In this case, for example, when thepredetermined number of frames is a plurality of frames, the imagecombination unit may obtain one or a plurality of positional shiftamounts on the basis of the predetermined number of positional shiftamounts and use the one or plurality of positional shift amounts. Inthis case, it is possible to generate a panoramic moving image with ahigh combination performance while suppressing a calculation amount.

In addition, in the present technique, for example, thepositional-shift-amount acquisition unit may obtain the positional shiftamounts after processing for matching spatial frequencies of the firstmoving image and the second moving image is performed. In this case, itis possible to improve a positional-shift-amount detection performance.

Another concept of the present technique is an image processing deviceincluding: a positional-shift-amount acquisition unit configured toacquire positional shift amounts of a predetermined number of framesfrom a first moving image and a second moving image captured by cameras,each of the first and second moving images including a plurality offrames; a frame selection unit configured to select the predeterminednumber of frames from the plurality of frames; and an image combinationunit configured to combine the first moving image and the second movingimage on the basis of the positional shift amounts of the predeterminednumber of frames to obtain a panoramic image.

In the present technique, the positional-shift-amount acquisition unitacquires positional shift amounts of a predetermined number of framesfrom a first moving image and a second moving image captured by cameras,each of the first and second moving images including a plurality offrames. The frame selection unit selects the predetermined number offrames from the plurality of frames on the basis of, for example, aframe-positional-shift-amount calculation performance. The imagecombination unit combines the first moving image and the second movingimage on the basis of the positional shift amounts of the predeterminednumber of frames, thereby obtaining a panoramic image.

As described above, in the present technique, positional shift amountsof a predetermined number of frames selected from a plurality of framesare acquired, and moving images are combined on the basis of thepositional shift amounts. Therefore, it is possible to generate apanoramic moving image with a high combination performance whilesuppressing a calculation amount.

In the present technique, for example, the positional-shift-amountacquisition unit may obtain the positional shift amounts afterprocessing for matching spatial frequencies of the first moving imageand the second moving image is performed. In addition, in the presenttechnique, for example, when the predetermined number of frames is aplurality of frames, the image combination unit may obtain one or aplurality of positional shift amounts on the basis of the predeterminednumber of positional shift amounts and uses the one or plurality ofpositional shift amounts.

Advantageous Effects of Invention

According to the present technique, it is possible to generate apanoramic moving image with a high combination performance whilesuppressing a calculation amount.

Note that effects described in this specification are merely examplesand are not limited, and an additional effect may be exerted.

BRIEF DESCRIPTION OF DRAWINGS

[FIG. 1] FIG. 1 is a block diagram showing a configuration example of apanoramic moving image generation device according to a firstembodiment.

[FIGS. 2A and 2B] FIGS. 2A and 2B are views for explaining generation ofa panoramic moving image from a plurality of moving images.

[FIG. 3] FIG. 3 is a block diagram showing an example of specificconfigurations of a positional-shift-amount acquisition unit and animage combination unit of the panoramic moving image generation device.

[FIG. 4] FIG. 4 is a view for explaining processing of a partial regioncutting-out unit.

[FIG. 5] FIG. 5 is a flowchart showing an example of processing in ascore calculation unit and a frame selection unit.

[FIG. 6] FIG. 6 shows a state in which a close subject exists when twomoving images are captured by two cameras A and B.

[FIGS. 7A and 7B] FIGS. 7A and 7B show examples of moving images Va andVb captured when a close subject exists.

[FIG. 8] FIG. 8 is a flowchart showing an example of processing in theframe selection unit.

[FIG. 9] FIG. 9 is a block diagram showing another example of thespecific configurations of the positional-shift-amount acquisition unitand the image combination unit of the panoramic moving image generationdevice.

[FIG. 10] FIG. 10 shows an example of a computer used when the panoramicmoving image generation device is configured by software.

[FIG. 11] FIG. 11 is a flowchart showing an example of panoramic imagegeneration processing in a computer.

[FIG. 12] FIG. 12 is a flowchart showing another example of thepanoramic image generation processing in a computer.

[FIG. 13] FIG. 13 is a flowchart showing another example of thepanoramic image generation processing in a computer.

[FIG. 14] FIG. 14 is a flowchart showing another example of thepanoramic image generation processing in a computer.

[FIG. 15] FIG. 15 is a block diagram showing a configuration example ofa panoramic moving image generation device according to a secondembodiment.

[FIGS. 16A and 16B] FIGS. 16A and 16B show examples of two images Va andVb captured by a first camera and a second camera adjacent to eachother.

[FIGS. 17A and 17B] FIGS. 17A and 17B show examples of two images Va andVb whose spatial frequency characteristics have been matched.

DESCRIPTION OF EMBODIMENT(S)

Hereinafter, forms for implementing an invention (hereinafter, referredto as “embodiments”) will be described. Note that description will beprovided in the following order.

1. First Embodiment 2. Second Embodiment 3. Modification Example 1.First Embodiment [Configuration Example of Panoramic Moving ImageGeneration Device]

FIG. 1 shows a configuration example of a panoramic moving imagegeneration device 100 according to a first embodiment. The panoramicmoving image generation device 100 performs positioning on moving imagesv, v+1, v+2, v+3, . . . , each of which includes a plurality of Nframes, to combine the moving images as shown in FIG. 2A and generates apanoramic moving image including the N frames as shown in FIG. 2B.

The panoramic moving image generation device 100 includes apositional-shift-amount acquisition unit 101 and an image combinationunit 102. The positional-shift-amount acquisition unit 101 acquirespositional shift amounts of a predetermined number of frames selectedfrom the N frames with respect to every two adjacent moving images(first moving image, second moving image) of the plurality of movingimages v, v+1, v+2, v+3, . . . . The image combination unit 102 performspositioning on every two adjacent moving images while referring to thepositional shift amounts of the predetermined number of frames acquiredin the positional-shift-amount acquisition unit 101 and combines themoving images, thereby generating a panoramic moving image PV.

FIG. 3 shows an example of specific configurations of thepositional-shift-amount acquisition unit 101 and the image combinationunit 102 of the panoramic moving image generation device 100. Herein, inorder to simplify description, an example where two moving images Va andVb are combined to generate a panoramic moving image PV will bedescribed.

The positional-shift-amount acquisition unit 101 includes a partialregion cutting-out unit 111, a distortion correction unit 112, aprojective transformation unit 113, a positional-shift-amountcalculation unit 114, a positional-shift-amount stabilization unit 115,a score calculation unit 116, and a frame selection unit 117. The imagecombination unit 102 includes a distortion correction unit 121, aprojective transformation unit 122, and a panorama combination unit 123.

The partial region cutting-out unit 111 receives the moving image Vacaptured by a camera A and the moving image Vb captured by a camera B asinput and cuts out regions (hatched parts) which are supposed to beoverlapped with each other as shown in FIG. 4. Ra indicates a cut-outregion of the moving image Va, and Rb indicates a cut-out region of themoving image Vb.

Herein, it is unnecessary to strictly calculate overlapping regions asthe cut-out regions. For example, approximate overlapping regions may beobtained in advance on the basis of an installation angle between twocameras that capture the moving image Va and the moving image Vb andinternal parameters of the cameras (lens distortion and otherinformation inherent to the cameras). Alternatively, a region having anarbitrary ratio with respect to the whole region may be defined as thecut-out region. This cutting-out makes it possible to reduce a regionthat is unnecessary for positional-shift-amount calculation describedbelow, and therefore it is possible to improve performance and reduce acalculation cost in subsequent processing.

The distortion correction unit 112 corrects distortion of the cut-outregions Ra and Rb cut out by the partial region cutting-out unit 111.Herein, distortion is lens distortion of a camera, distortion caused byan installation error of an image sensor, and the like. The distortioncorrection unit 112 corrects the distortion in consideration of in whichregion in the moving images Va and Vb the cut-out regions Ra and Rb arelocated.

The projective transformation unit 113 projectively transforms thecut-out regions Ra and Rb whose distortion has been corrected in thedistortion correction unit 112. Herein, projective transformation is,for example, processing of transforming a flat surface into a flatsurface, a cylindrical surface, and a spherical surface. Desiredprocessing is performed depending on a panoramic moving image to begenerated. A user may select the kind of projective transformation and amethod thereof. Alternatively, appropriate projective transformation maybe automatically selected on the basis of an angle of view and aninstallation condition of each camera. The projective transformationunit 113 performs projective transformation in consideration of in whichregion in the moving images Va and Vb the cut-out regions Ra and Rb arelocated.

The positional-shift-amount calculation unit 114 performs, in eachframe, positioning of the cut-out regions Ra and Rb that have beenprojectively transformed in the projective transformation unit 113 toobtain positional shift amounts and reliability of the positional shiftamounts. Positioning is performed by, for example, a method using blockmatching or a method using feature matching. The positional shiftamounts indicate shifts between the moving image Va and the moving imageVb obtained as a result of positioning and are denoted by, for example,vectors or projection matrixes.

The reliability of the positional shift amounts is, for example, a valueindicating a degree of spatial deviation of features obtained whenvectors, projection matrixes, or the like are calculated or a degree ofvariation in local vectors in a frame. The reliability indicates ahigher value when, for example, features can be detected without spatialdeviation, a result obtained by projectively transforming the movingimage Va and obtaining a difference between the moving image Va and themoving image Vb is small (the moving image Va and the moving image Vbmay be replaced with each other), or local vectors having similardirections/magnitudes can be detected as a whole.

The positional shift stabilization unit 115 calculates L (1≤L≤M)stabilized positional shift amounts on the basis of positional shiftamounts calculated in a predetermined number of frames, e.g., positionalshift amounts of M frames. Stabilization is performed by, for example, amethod in which an average (or a weighted average) of the positionalshift amounts of the M frames is taken, a method in which positionalshift amounts that are largely deviated from the M positional shiftamounts are excluded and then an average (or a weighted average) istaken, or a method in which the positional shift amounts of the M framesare classified into classes on the basis of an arbitrary criterion, anarbitrary class is selected, and an average (or a weighted average) ofpositional shift amounts in the class is taken. At this time, thereliability of the positional shift amounts may be used for performingexclusion and weighting.

As described above, in the case where each moving image includes Nframes, the frame selection unit 117 selects M frames whose positionalshift amounts are to be calculated. For example, the frame selectionunit 117 selects appropriate M frames in terms of apositional-shift-amount calculation performance on the basis of scorescalculated in the score calculation unit 116, i.e., extracts M frames infavorable order and excludes unfavorable frames. Further, for example,the frame selection unit 117 selects M frames on the basis of a user'ssetting operation.

As determination criteria of frame selection in the frame selection unit117, for example, any one or a plurality of the following points areincluded.

(1) A frame that does not include a close subject(2) A frame that is not obtained by irregular camerawork(3) A frame having a small blur/defocus(4) A frame having a reliable positional shift amount(5) A frame whose positional shift amount is not largely deviated frompositional shift amounts of other frames(6) A frame having a positional shift amount that belongs to anarbitrary class as a result of class classification(7) M arbitrary consecutive frames(8) M frames having arbitrary intervals (unchangeable, changeable)

For the above determination criteria, for example, a moving image outputfrom the projective transformation unit 113, information on a positionalshift amount and reliability calculated in the positional-shift-amountcalculation unit 114, sensor information, and control informationindicating irregular camerawork and the like are supplied to the scorecalculation unit 116. Further, for example, not only scores calculatedin the score calculation unit 116 but also information set by a user,such as the number of frames to be selected, an interval between framesto be selected, the first and last sections to be excluded, and classes,is supplied to the frame selection unit 117.

The score calculation unit 116 calculates a score in each frameregarding, for example, (1) to (5), and the frame selection unit 117selects M frames on the basis of the calculated scores.

A flowchart in FIG. 5 shows an example of processing in the scorecalculation unit 116 and the frame selection unit 117. In Step ST1, theprocessing is started. In Step ST2, one or a plurality of arbitraryscores in (1) to (5) are calculated in the unit of frame. In Step ST3,in the case where a plurality of scores are calculated, the scores arelinearly combined. Herein, linear combination means, for example,combination using an average, a weighted average, or the like. In StepST4, M frames are selected in descending order of score. In Step ST5,the processing is terminated.

The individual determination criteria will be further described.

“(1) A Frame That Does Not Include a Close Subject”

When moving images are captured by a plurality of cameras and a closesubject exists between the cameras, different images exist in thecaptured moving images, and therefore it is difficult to calculate apositional shift amount. FIG. 6(a) shows a state in which a closesubject exists when the two moving images Va and Vb are captured by thetwo cameras A and B. A subject b is included in an angle of view of thecamera B but is not included in an angle of view of the camera A.

Thus, the captured moving images Va and Vb are as shown in FIGS. 7A and7B. In this case, the subject b exists only in the moving image Vb.Further, most part of a subject a existing in the moving image Va andthe moving image Vb in common is obstructed by the subject b in themoving image Vb. When the close subject occupies most of an overlappingregion as described above, it is difficult to perform positioning of themoving image Va and the moving image Vb.

Therefore, it is desirable to exclude a frame in which the close subjectexists from targets to be subjected to positional-shift-amountcalculation. For example, a case where a person passes a camera is atypical example. Detection of the close subject can be achieved by, forexample, using sensor information of a camera obtained when a movingimage is captured, using a difference or correlation between left andright moving images, or using a recognition technique. Based on a resultof the detection, for example, the score calculation unit 116 reduces ascore as a ratio of the close subject is higher.

“(2) A Frame That is Not Obtained by Irregular Camerawork”

A camera may be fixed or moved at the time of capturing a moving image.However, in the case where continuous camerawork is not performed, i.e.,the camera suddenly moves or is greatly shaken, an image different fromimages before and after the corresponding frame appears in an angle ofview of the camera. Therefore, a peculiar positional shift amount isgenerated and it is difficult to stabilize positional shift amounts insome cases.

Thus, it is desirable to exclude a frame obtained by irregularcamerawork. Detection of irregular camerawork may be performed byrecording sensor information of a gyrosensor or the like of a camera orcan be achieved by performing image processing to check a change ofmotion vectors or statistics of images. Based on a result of thedetection, for example, the score calculation unit 116 reduces a scoreas a change between a frame and frames therebefore/thereafter orperipheral frames in an arbitrary period is greater.

“(3) A Frame Having a Small Blur/Defocus”

When an image is defocused due to a blur caused by camera shake, a blurcaused by motion of a subject, out-of-focus, and the like, it isdifficult to calculate a positional shift amount in some cases.Therefore, it is desirable to exclude such a frame from targets to besubjected to positional-shift-amount calculation. Camera shake can bedetected on the basis of, for example, information of a sensor, such asa gyrosensor, obtained when an image is captured by a camera.Out-of-focus can be detected on the basis of, for example, informationof a sensor obtained when an image is captured by a camera orinformation on focus control.

It is possible to calculate to what degree defocusing is generated as aresult on the basis of a captured image in common to a blur caused bycamera shake, a blur caused by motion of a subject, out-of-focus, andthe like. For example, generation of defocusing can be checked on thebasis of presence/absence of a high-frequency component of a signal. Thescore calculation unit 116 detects a blur/defocus on the basis of suchinformation and reduces a score as the blur/defocus is larger.

“(4) A Frame Having a Reliable Positional Shift Amount”

Reliability of a positional shift amount is a value calculated in thepositional-shift-amount calculation unit 114. The score calculation unit116 increases a score as this value is larger. For example, thepositional-shift-amount calculation unit 114 calculates a projectionmatrix for performing fitting of patterns in two images and furtheranalyzes this projection matrix, thereby obtaining a positional shiftamount, and converts an error of this fitting into a weight to definethe reliability.

“(5) A Frame Whose Positional Shift Amount is Not Largely Deviated fromPositional Shift Amounts of Other Frames”

In the case where a positional shift amount of a target frame, which isoutput by the positional-shift-amount calculation unit 114, is largelydeviated from positional shift amounts of other frames, there is apossibility that the positional shift amount in the frame is notcorrectly calculated. Therefore, it is desirable to exclude the frame. Adegree of deviation of a positional shift amount from positional shiftamounts in other frames may be obtained by performing differentiationbetween frames or can be quantified by, for example, a differenceabsolute value or a square of a difference from a total or localaverage. The score calculation unit 116 reduces a score as the degree ofdeviation is higher.

“(6) A Frame Having a Positional Shift Amount That Belongs to anArbitrary Class as a Result of Class Classification”

The frame selection unit 117 performs class classification on the basisof an arbitrary criterion, selects an arbitrary class from a pluralityof classified classes, and selects M frames therefrom. In this case,information on a class to be finally selected is supplied by, forexample, a user.

The criterion of the class classification is, for example, classifyingframes having similar positional shift amounts among frames into thesame class. Selection of an arbitrary class is, for example, selecting aclass having the largest number of frames. Note that a method ofselecting M frames from the selected class is, for example, a methodusing the above scores.

A flowchart in FIG. 8 shows an example of processing in the frameselection unit 117. In Step ST11, the processing is started. In StepST12, class classification is performed. In Step ST13, an arbitraryclass is selected. In Step ST14, M frames are selected from the selectedclass. In Step ST15, the processing is terminated.

“(7) M Arbitrary Consecutive Frames”

The frame selection unit 117 selects M arbitrary consecutive frames. Forexample, the frame selection unit 117 calculates arbitrary scores of (1)to (5) in each frame, adds up scores of M consecutive frames, andselects a section (M frames) having the highest score. Alternatively,the frame selection unit 117 selects a section of M consecutive framesspecified by a user.

“(8) M Frames Having Arbitrary Intervals (Unchangeable, Changeable)”

The frame selection unit 117 selects M frames having arbitrary intervals(unchangeable, changeable). For example, the frame selection unit 117calculates arbitrary scores of (1) to (5) at arbitrary intervals in eachframe, adds up scores of M frames, and selects an interval having thehighest score. The intervals may be fixed or changed. Alternatively, auser may specify intervals.

In the configuration example in FIG. 3, the processing is performed inthe following order: partial cutting-out; distortion correction;projective transformation; and calculation of a positional shift amount.However, the processing does not necessarily need to be performed in theabove order. For example, it is also considered that distortioncorrection and projective transformation are performed and then partialcutting-out is performed. Further, there is the case where M frames areselected and then positional shift amounts of the M frames arecalculated and the case where positional shift amounts are calculated inall frames and then the M frames are selected.

The distortion correction unit 121, as well as the above distortioncorrection unit 112, corrects distortion of the moving images Va and Vb.The projective transformation unit 122, as well as the projectivetransformation unit 113, projectively transforms the moving images Vaand Vb whose distortion has been corrected. The panorama combinationunit 123 combines the moving image Va and the moving image Vb on thebasis of the L (1≤L≤M) stabilized positional shift amounts obtained inthe positional-shift-amount stabilization unit 115, thereby generating apanoramic moving image PV.

For example, in the case of L=1, a single positional shift amount isapplied to combining all frames. Meanwhile, for example, in the case ofL>1, a frame having no positional shift amount is interpolated so thatthe positional shift amount is gently changed (except for a scenechange). Stitching processing of images (combination processing ofoverlapping regions) is performed by, for example, blending the movingimage Va and the moving image Vb or using any one of the moving images.

FIG. 9 shows another example of the specific configurations of thepositional-shift-amount acquisition unit 101 and the image combinationunit 102 of the panoramic moving image generation device 100. In FIG. 9,parts corresponding to the parts in FIG. 3 are denoted by the samereference signs, and detailed description thereof is omitted. FIG. 9shows an example where the positional-shift-amount acquisition unit 101does not include the score calculation unit 116. In this example,determination criteria of frame selection in the frame selection unit117 are, for example, (6) to (8). Other configurations are the same asthe configurations in FIG. 3.

Note that the panoramic moving image generation device 100 (see FIG. 3and FIG. 9) can be configured by hardware and can also be configured bysoftware. For example, the panoramic moving image generation device canbe realized by executing programs in a general computer (including amobile device, a device connected via a network, and a cloud) 300 shownin FIG. 10.

The computer 300 is configured by connecting a central processing unit(CPU) 311, a graphics processing unit (GPU) 312, a storage device 313,an input device 314, an output device 315, and a communication device316 to a bus 317. The input device 314 includes a keyboard, a mouse, amicrophone, and the like. The output device 315 includes a display, aspeaker, and the like.

The storage device 313 includes a hard disk drive (HDD), a nonvolatilememory, and the like. The storage device 313 stores a partial regioncutting-out program, a distortion correction program, a projectivetransformation program, a positional-shift-amount calculation program, apositional-shift-amount stabilization program, a frame selectionprogram, a panorama combination program, and the like. The computer 300can implement an arbitrary combination of the programs.

A flowchart in FIG. 11 shows an example of panoramic image generationprocessing in the computer 300. In this processing example, positionalshift amounts are calculated by using M frames from the top, and thepositional shift amounts are stabilized, then a panoramic moving imageis generated, and the above point (7) is used as a determinationcriterion of frame selection. Note that distortion correction andprojective transformation are implemented as necessary (may not beimplemented if not necessary).

In Step ST21, the computer 300 starts the processing. Thereafter, inStep ST22, the computer 300 selects the top M frames of each of themoving images Va and Vb. In this case, a first certain section may beexcluded because the first certain section is considered to be anunstable section.

In Step ST23, the computer 300 cuts out partial regions Ra and Rb fromthe M frames of each of the moving images Va and Vb (see FIG. 4). InStep ST24, the computer 300 corrects distortion of the partial regionsRa and Rb. In Step ST25, the computer 300 projectively transforms thepartial regions Ra and Rb whose distortion has been corrected.

In Step ST26, the computer 300 calculates positional shift amounts ofthe M frames selected in Step ST22. Herein, the computer 300 detectsfeature values with the use of an algorithm for obtaining a featurevalue in a region, such as Scale Invariant Feature Transform (SIFT),Speed-Up Robust Features (SURF), Binary Robust Invariant ScalableKeypoints (BRISK), Histogram of Oriented Gradients (HOG), or LocalBinary Pattern (LBP). Then, the computer 300 performs matchingprocessing using the detected feature values to calculate positionalshift amounts between the partial regions Ra and Rb. In Step ST27, thecomputer 300 stabilizes the positional shift amounts to obtain L (1≤L≤M)stabilized positional shift amounts.

After the processing is started in Step ST21, in Step ST28, the computer300 corrects distortion of all N frames of each of the moving images Vaand Vb. In Step ST29, the computer 300 projectively transforms all the Nframes whose distortion has been corrected.

In Step ST30, the computer 300 combines the N frames of the moving imageVa and the N frames of the moving image Vb obtained in Step ST29,respectively, while referring to the stabilized positional shiftamounts, thereby generating a panoramic moving image PV of the N frames.After Step ST30, in Step ST31, the computer 300 terminates theprocessing.

A flowchart in FIG. 12 shows another example of the panoramic imagegeneration processing in the computer 300. In this processing example, Mframes are selected on the basis of presence/absence of a close subject,presence/absence of irregular camerawork, and presence/absence of ablur/defocus, and positional shift amounts are calculated with the useof the M frames to stabilize the positional shift amounts, then apanoramic moving image is generated, and (1) to (3) are used asdetermination criteria of frame selection. Note that scores (1) to (3)may be calculated in parallel. Distortion correction and projectivetransformation are implemented as necessary (may not be implemented ifnot necessary).

In Step ST41, the computer 300 starts the processing. Thereafter, inStep ST42, the computer 300 calculates scores related topresence/absence of a close subject. In Step ST43, the computer 300calculates scores related to presence/absence of irregular camerawork.In Step ST44, the computer 300 calculates scores related topresence/absence of a blur/defocus. In Step ST45, the computer 300linearly combines the scores.

In Step ST46, the computer 300 selects M frames of each of the movingimages Va and Vb with the use of the scores obtained in Step ST45. InStep ST47, the computer 300 cuts out the partial regions Ra and Rb fromthe selected M frames (see FIG. 4). In Step ST48, the computer 300corrects distortion of the partial regions Ra and Rb. In Step ST49, thecomputer 300 projectively transforms the partial regions Ra and Rb whosedistortion has been corrected.

In Step ST50, the computer 300 calculates M positional shift amounts.Herein, the computer 300 detects feature values with the use of analgorithm for obtaining a feature value in a region, such as SIFT, SURF,BRISK, HOG, or LBP. Then, the computer 300 performs matching processingusing the detected feature values to calculate positional shift amountsbetween the partial regions Ra and Rb. In Step ST51, the computer 300stabilizes the positional shift amounts to obtain L (1≤L≤M) stabilizedpositional shift amounts.

After the processing is started in Step ST41, in Step ST52, the computer300 corrects distortion of all N frames of each of the moving images Vaand Vb. In Step ST53, the computer 300 projectively transforms all the Nframes whose distortion has been corrected.

In Step ST54, the computer 300 combines the N frames of the moving imageVa and the N frames of the moving image Vb obtained in Step ST53,respectively, while referring to the stabilized positional shiftamounts, thereby generating a panoramic moving image PV of the N frames.After Step ST54, in Step ST55, the computer 300 terminates theprocessing.

A flowchart in FIG. 13 shows another example of the panoramic imagegeneration processing in the computer 300. In this processing example,positional shift amounts are calculated, and M frames are selected onthe basis of reliability of the positional shift amounts and the degreeof deviation thereof to stabilize the positional shift amounts, then apanoramic moving image is generated, and the above points (4) and (5)are used as determination criteria of frame selection. Note that scoresof (4) and (5) may be calculated in parallel. Distortion correction andprojective transformation are implemented as necessary (may not beimplemented if not necessary).

In Step ST61, the computer 300 starts the processing. Thereafter, inStep ST62, the computer 300 corrects distortion of all N frames of eachof the moving images Va and Vb. In Step ST63, the computer 300projectively transforms all the N frames whose distortion has beencorrected.

In Step ST64, the computer 300 cuts out the partial regions Ra and Rbfrom the N frames (see FIG. 4). In Step ST65, the computer 300calculates positional shift amounts of the N frames. Herein, thecomputer 300 detects feature values with the use of an algorithm forobtaining a feature value in a region, such as SIFT, SURF, BRISK, HOG,or LBP. Then, the computer 300 performs matching processing using thedetected feature values to calculate positional shift amounts betweenthe partial regions Ra and Rb.

In Step ST66, the computer 300 calculates scores on the basis of thereliability of the positional shift amounts. In Step ST67, the computer300 calculates scores on the basis of the degree of deviation of thepositional shift amounts. In Step ST68, the computer 300 linearlycombines the scores.

In Step ST69, the computer 300 selects M frames with the use of thescores obtained in Step ST68. In Step ST70, the computer 300 stabilizesM positional shift amounts of the selected M frames to obtain L (1≤L≤M)stabilized positional shift amounts.

In Step ST71, the computer 300 combines the N frames of the moving imageVa and the N frames of the moving image Vb obtained in Step ST63,respectively, while referring to the stabilized positional shiftamounts, thereby generating a panoramic moving image PV of the N frames.After Step ST71, in Step ST72, the computer 300 terminates theprocessing.

A flowchart in FIG. 14 shows another example of the panoramic imagegeneration processing in the computer 300. In this processing example,positional shift amounts are calculated and frames are classified intoclasses on the basis of the positional shift amounts, and a class isselected and M frames are selected, then the positional shift amountsare stabilized, and the above point (6) is used as a determinationcriterion of frame selection. Note that arbitrary scores of (1) to (5)calculated in the point (6) may be calculated in parallel. Distortioncorrection and projective transformation are implemented as necessary(may not be implemented if not necessary).

In Step ST81, the computer 300 starts the processing. Thereafter, inStep ST82, the computer 300 corrects distortion of all N frames of eachof the moving images Va and Vb. In Step ST83, the computer 300projectively transforms all the N frames whose distortion has beencorrected.

In Step ST84, the computer 300 cuts out the partial regions Ra and Rbfrom the N frames (see FIG. 4). In Step ST85, the computer 300calculates positional shift amounts of the N frames. Herein, thecomputer 300 detects feature values with the use of an algorithm forobtaining a feature value in a region, such as SIFT, SURF, BRISK, HOG,or LBP. Then, the computer 300 performs matching processing using thedetected feature values to calculate positional shift amounts betweenthe partial regions Ra and Rb.

In Step ST86, the computer 300 classifies the frames into classes on thebasis of the positional shift amounts. In Step ST87, the computer 300selects a class having the largest number of frames. In Step ST88,regarding the frames in the selected class, the computer 300 calculatesarbitrary scores of (1) to (5). In Step ST89, the computer 300 linearlycombines the scores.

In Step ST90, the computer 300 selects M frames with the use of thescores obtained in Step ST89. In Step ST91, the computer 300 stabilizesM positional shift amounts of the selected M frames to obtain L (1≤L≤M)stabilized positional shift amounts.

In Step ST92, the computer 300 combines the N frames of the moving imageVa and the N frames of the moving image Vb obtained in Step ST83,respectively, while referring to the stabilized positional shiftamounts, thereby generating a panoramic moving image PV of the N frames.After Step ST92, in Step ST93, the computer 300 terminates theprocessing.

The panoramic image generation processing in the computer 300, which isshown in the flowcharts in FIGS. 11 to 14, is merely examples, andpanoramic image generation processing is not limited thereto. Note that,when scores are calculated earlier, the following can be said in commonto all processing.

(1) N frames can be reduced to M frames early (reduction in calculationamount)

(2) Accuracy of usable information is low (no distortion correction, noprojective transformation, no positional shift amount, no reliability,and the like)

As described above, the panoramic moving image generation device 100shown in FIG. 1 acquires positional shift amounts of M frames selectedfrom N frames and generates a panoramic moving image PV of the N frameson the basis of the positional shift amounts of the M frames. Thus, forexample, only accurate positional shift amounts can be acquired as thepositional shift amounts, and therefore a high-quality panoramic movingimage can be generated. Further, for example, a calculation cost forobtaining a positional shift amount can be reduced.

2. Second Embodiment [Configuration Example of Panoramic Moving ImageGeneration Device]

FIG. 15 shows a configuration example of a panoramic moving imagegeneration device 100A according to a second embodiment. In FIG. 15,parts corresponding to the parts in FIG. 1 are denoted by the samereference signs, and detailed description thereof is omitted asappropriate. The panoramic moving image generation device 100A includesthe positional-shift-amount acquisition unit 101, the image combinationunit 102, and an MTF adjustment unit 103.

The MTF adjustment unit 103 makes adjustment for matching spatialfrequency characteristics of moving images v, v+1, v+2, v+3, . . . . TheMTF adjustment unit 103 performs filtering using a low-pass filter or aband-pass filter to match the spatial frequency characteristics of therespective moving images. In this case, a filter characteristic may befixed or may be adaptively changed in accordance with the spatialfrequency characteristics of the respective moving images.

In the case where the filter characteristic is changed, the MTFadjustment unit 103 performs, for example, Fourier transform processingto detect the spatial frequency characteristics of the respective movingimages. Then, the MTF adjustment unit 103 changes the filtercharacteristic so that the spatial frequency characteristics of therespective moving images are restricted to a spatial frequencycharacteristic obtained on the basis of a result of detection of thespatial frequency characteristics of the respective moving images, e.g.,a spatial frequency characteristic having the highest spatial frequencywhich all the moving images have in common. That is, the MTF adjustmentunit 103 changes a cutoff frequency of the low-pass filter as the filtercharacteristic to restrict the spatial characteristics of the respectivemoving images v, v+1, v+2, v+3, . . . to a spatial frequencycharacteristic having the highest spatial frequency which both have incommon. Note that cutoff frequencies for the moving images v, v+1, v+2,v+3, . . . are the same. The MTF adjustment unit 103 only needs to matchthe spatial frequency characteristics of the moving images v, v+1, v+2,v+3, . . . and may perform filtering on the moving images v, v+1, v+2,v+3, . . . with the use of a low-pass filter having a fixed cutofffrequency.

The positional-shift-amount acquisition unit 101 acquires positionalshift amounts with the use of moving images v′, v+1′, v+2′, v+3′, . . .whose spatial frequency characteristics have been adjusted in the MTFadjustment unit 103. The image combination unit 102 performs positioningon every two adjacent moving images while referring to the positionalshift amounts of a predetermined number of frames acquired in thepositional-shift-amount acquisition unit 101 and combines the movingimages, thereby generating a panoramic moving image PV. Althoughdetailed description is omitted, processing in thepositional-shift-amount acquisition unit 101 and the image combinationunit 102 is similar to the processing in the panoramic moving imagegeneration device 100 shown in FIG. 1.

As described above, in the panoramic moving image generation device 100Ashown in FIG. 15, the moving images v, v+1, v+2, v+3, . . . are notdirectly supplied to the positional-shift-amount acquisition unit 101,but the moving images v′, v+1′, v+2′, v+3′, . . . whose spatialfrequency characteristics have been matched are supplied thereto.Therefore, when a positional shift amount is acquired, it is possible toimprove an acquisition performance of a positional shift amount betweenoverlapping regions in two adjacent images by detecting feature values.

FIGS. 16A and 16B show examples of two images Va and Vb captured by afirst camera and a second camera adjacent to each other. In thisexample, spatial frequency characteristics (MTF) of the two images aredifferent from each other due to a difference in lens and focus betweenthe first camera and the second camera. In this case, it is highlypossible that feature values are not detected at the same position P1due to a difference in spatial frequency characteristic. On thecontrary, FIGS. 17A and 17B show examples of two images Va′ and Vb′whose spatial frequency characteristics have been matched. In this case,it is highly possible that feature values are detected at the sameposition P1.

Therefore, in the panoramic moving image generation device 100A shown inFIG. 15, it is possible to improve an acquisition performance of apositional shift amount in the positional-shift-amount calculation unit101 even in the case where cameras are different in lens and focus.Therefore, the panoramic moving image generation device 100A canfavorably combine the moving images v, v+1, v+2, v+3, . . . and canobtain a high-quality panoramic moving image PV.

3. Modification Example

Note that, although description has not been provided in the abovedescription, it is also considered that the panoramic moving imagegeneration device 100 or 100A shown in FIG. 1 or FIG. 15 is mounted on acamera, a portable terminal having a camera function, or the like.However, the panoramic moving image generation device 100 or 100A canalso be mounted on a computer (server) on a network or cloud. In thiscase, the camera or the portable terminal having a camera functiontransmits a captured moving image to the computer (server) on thenetwork or cloud and receives a panoramic moving image that is a resultthereof. This makes it possible to reduce a processing load of thecamera or the portable terminal having a camera function. Additionally,the present technology may also be configured as below.

(1)

-   An image processing device, including:-   a positional-shift-amount acquisition unit configured to include a    frame selection unit configured to select a first moving image and a    second moving image, each of which has a predetermined number of    frames, from a first moving image and a second moving image, each of    which has a plurality of frames captured by a camera, and acquire    positional shift amounts of the predetermined number of frames from    the first moving image and the second moving image, each of which    has the predetermined number of frames selected in the frame    selection unit.

(2)

-   The image processing device according to (1),-   wherein the frame selection unit selects the predetermined number of    frames on the basis of sensor output and/or image processing    results.

(3)

-   The image processing device according to (1) or (2),-   wherein the frame selection unit selects, as the predetermined    number of frames, a frame having a small number of close subjects.

(4)

-   The image processing device according to any of (1) to (3),-   wherein the frame selection unit selects, as the predetermined    number of frames, a frame that is not obtained by irregular    camerawork.

(5)

-   The image processing device according to any of (1) to (4),-   wherein the frame selection unit selects, as the predetermined    number of frames, a frame having a large number of high frequency    components.

(6)

-   The image processing device according to any of (1) to (5),-   wherein the frame selection unit selects, as the predetermined    number of frames, a frame having high reliability.

(7)

-   The image processing device according to any of (1) to (6),-   wherein the frame selection unit selects, as the predetermined    number of frames, frames having close positional shift amounts.

(8)

-   The image processing device according to any of (1) to (7),-   wherein the frame selection unit classifies the positional shift    amounts into classes and selects, as the predetermined number of    frames, a frame having positional shift amounts belonging to a    predetermined class.

(9)

-   The image processing device according to any of (1) to (8),-   wherein the frame selection unit selects, as the predetermined    number of frames, arbitrary consecutive frames.

(10)

-   The image processing device according to any claims 1 of (1) to (8),-   wherein the frame selection unit selects, as the predetermined    number of frames, frames having an arbitrary interval.

(11)

-   The image processing device according to any of (1) to (10),-   wherein the frame selection unit does not select, as the    predetermined number of frames, frames in first and/or last certain    periods.

(12)

-   The image processing device according to any of (1) to (11), further    including:-   an image combination unit configured to combine the first moving    image and the second moving image on the basis of the positional    shift amounts of the predetermined number of frames to obtain a    panoramic moving image.

(13)

-   The image processing device according to (12),-   wherein, when the predetermined number of frames is a plurality of    frames, the image combination unit obtains one or a plurality of    positional shift amounts on the basis of the predetermined number of    positional shift amounts and uses the one or plurality of positional    shift amounts.

(14)

-   The image processing device according to any of (1) to (15),-   wherein the positional-shift-amount acquisition unit obtains the    positional shift amounts after processing for matching spatial    frequencies of the first moving image and the second moving image is    performed.

(15)

-   An image processing method, including:-   a frame selection step of selecting a first moving image and a    second moving image, each of which has a predetermined number of    frames, from a first moving image and a second moving image, each of    which has a plurality of frames captured by a camera; and-   a positional-shift-amount acquisition step of acquiring positional    shift amounts of the predetermined number of frames from the first    moving image and the second moving image, each of which has the    predetermined number of frames selected in the frame selection step.

(16)

-   A program for causing a computer to function as:-   frame selection means for selecting a first moving image and a    second moving image, each of which has a predetermined number of    frames, from a first moving image and a second moving image, each of    which has a plurality of frames captured by a camera; and-   positional-shift-amount acquisition means for acquiring positional    shift amounts of the predetermined number of frames from the first    moving image and the second moving image, each of which has the    predetermined number of frames selected in the frame selection    means.

REFERENCE SIGNS LIST

100, 100A panoramic moving image generation device101 positional-shift-amount acquisition unit102 image combination unit103 MTF adjustment unit111 partial region cutting-out unit112 distortion correction unit113 projective transformation unit114 positional-shift-amount calculation unit115 positional-shift-amount stabilization unit116 score calculation unit117 frame selection unit121 distortion correction unit122 projective transformation unit123 panorama combination unit300 computer

311 CPU 312 GPU

313 storage device314 input device315 output device316 communication device

1. An image processing device, comprising: circuitry configured to:select a number of frames from a first moving image and a second movingimage, wherein each of the first moving image and the second movingimage has a plurality of frames captured by a camera; and acquirepositional shift amounts of the number of frames from the first movingimage and the second moving image.
 2. The image processing deviceaccording to claim 1, wherein the circuitry is further configured tostabilize the positional shift amounts based on an average of thepositional shift amounts of the number of frames.
 3. The imageprocessing device according to claim 1, wherein: the circuitry isfurther configured to stabilize the positional shift amounts based on anaverage of positional shift amounts of frames of the plurality offrames, and a value of each of the positional shift amountscorresponding to each of the frames is in a specific range.
 4. The imageprocessing device according to claim 1, wherein the circuitry is furtherconfigured to: classify the positional shift amounts into a plurality ofclasses; and stabilize the positional shift amounts based on an averageof positional shift amounts belonging to a class of the plurality ofclasses.
 5. The image processing device according to claim 1, whereinthe circuitry is further configured to select the number of frames in aspecific order.
 6. The image processing device according to claim 2,wherein the circuitry is further configured to combine the first movingimage and the second moving image based on the stabilized positionalshift amounts to obtain a panoramic moving image.
 7. An image processingmethod, comprising: in an image processing device: selecting a number offrames from a first moving image and a second moving image, wherein eachof the first moving image and the second moving image has a plurality offrames captured by a camera; and acquiring positional shift amounts ofthe number of frames from the first moving image and the second movingimage.
 8. The image processing method according to claim 7, furthercomprising stabilizing the positional shift amounts based on an averageof the positional shift amounts of the number of frames.
 9. The imageprocessing method according to claim 7, further comprising stabilizingthe positional shift amounts based on an average of positional shiftamounts of frames of the plurality of frames, wherein a value of each ofthe positional shift amounts corresponding to each of the frames is in aspecific range.
 10. The image processing method according to claim 7,further comprising: classifying the positional shift amounts into aplurality of classes; and stabilizing the positional shift amounts basedon an average of positional shift amounts belonging to a class of theplurality of classes.
 11. The image processing method according to claim7, wherein the selection of the number of frames is in a specific order.12. The image processing method according to claim 8, further comprisingcombining the first moving image and the second moving image based onthe stabilized positional shift amounts to obtain a panoramic movingimage.
 13. A non-transitory computer-readable medium having storedthereon computer-executable instructions which, when executed by acomputer, cause the computer to execute operations, the operationscomprising: selecting a number of frames from a first moving image and asecond moving image, wherein each of the first moving image and thesecond moving image has a plurality of frames captured by a camera; andacquiring positional shift amounts of the number of frames from thefirst moving image and the second moving image.
 14. The non-transitorycomputer-readable medium according to claim 13, wherein the operationsfurther comprising stabilizing the positional shift amounts based on anaverage of the positional shift amounts of the number of frames.
 15. Thenon-transitory computer-readable medium according to claim 13, whereinthe operations further comprising stabilizing the positional shiftamounts based on an average of positional shift amounts of frames of theplurality of frames, wherein a value of each of the positional shiftamounts corresponding to each of the frames is in a specific range. 16.The non-transitory computer-readable medium according to claim 13,wherein the operations further comprising: classifying the positionalshift amounts into a plurality of classes; and stabilizing thepositional shift amounts based on an average of positional shift amountsbelonging to a class of the plurality of classes.
 17. The non-transitorycomputer-readable medium according to claim 13, wherein the selection ofthe number of frames is in a specific order.
 18. The non-transitorycomputer-readable medium according to claim 14, wherein the operationsfurther comprising combining the first moving image and the secondmoving image based on the stabilized positional shift amounts to obtaina panoramic moving image.